import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
browser = webdriver.Chrome()
url = 'http://www.runoob.com/try/try.php?filename=jqueryui-api-droppable'
browser.get(url)
browser.switch_to.frame('iframeResult')#切换到子Frame里面，然后常识获取子Frame里的logo节点（这是不能找到的），找不到就会抛出异常
try:
    logo = browser.find_element_by_class_name('logo')
except NoSuchElementException:
    print('NO LOGO')
browser.switch_to.parent_frame()#重新切回父级frame，然后重新获取节点
logo = browser.find_element_by_class_name('navbar-header.logo')
logo1 = browser.find_element_by_class_name('logo')
print(logo)
print(logo1)
print(logo.text)
print(logo1.text)